//
//  EntityManager.h
//  objectiverecord
//
//  Created by Gang.Wang on 12-5-18.
//  Copyright (c) 2012年 yuike. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Entity.h"

@interface EntityManager : NSObject 
{
    NSString* dbPath;
    DatabaseProvider* dbProvider;
}

- (id)initWithDataPath:(NSString *)path;
- (NSString *)sqliteVersion;

- (Entity *)create:(NSString *)className;
- (void) delete:(NSString *)className;

- (void) delete:(NSString *)className withArgument:(NSDictionary *) arg;
- (NSArray *)find:(NSString *)className;

- (NSArray *)find:(NSString *)className withArgument:(NSDictionary *) arg;

- (NSString *)getdbPath;

- (NSInteger) count:(NSString *)className;
- (id) find:(NSString *)className rowid:(NSInteger) rowid;

- (NSArray *) rowids:(NSString *)className withArgument:(NSDictionary *) arg;

- (NSArray *) find:(NSString *)className withField:(NSString *) field withArgument:(NSDictionary *) arg;


+ (NSString *) getTableNameWithClassName:(NSString * ) className;
@end

